package net.gzw1993.runmate.activity;


import android.media.Image;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

import net.gzw1993.runmate.R;
import net.gzw1993.runmate.activity.BaseActivity;
import net.gzw1993.runmate.adapter.ImageAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
public class YuepaoTipsActivity extends BaseActivity {
    @ViewInject(R.id.set_yuepao_vp)
    ViewPager viewPager;
    private int[] images = {R.mipmap.tips_1, R.mipmap.tips_2, R.mipmap.tips_3, R.mipmap.tips_4, R.mipmap.tips_5, R.mipmap.tips_6, R.mipmap.tips_7};
    private ImageView imageview;
    List<ImageView> imgs= new ArrayList<>();

    @Override
    public void onStart() {
        super.onStart();

    }

    public YuepaoTipsActivity() {
        // Required empty public constructor
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_yuepao_tips);
        ViewUtils.inject(this);
        initView();
    }

    private void initView() {
        for (int i = 0; i < 7; i++) {
            imageview = new ImageView(this);
            imageview.setImageResource(images[i]);
            imgs.add(imageview);
        }
        ImageAdapter adapter = new ImageAdapter(imgs);
        viewPager.setAdapter(adapter);
    }


}
